package service;

import java.util.*;

import beans.*;
import db.*;


public class indentService {
	
	public List<indentBean> browse(){
		indentDAO dao =new indentDAO();
		return dao.getAllRecords();
	}
	
	public boolean addindent(indentBean indent)
	{
		indentDAO indentDao=new indentDAO();
		return indentDao.insertRecord(indent);
	}
	
	public indentBean getRecord(int indentId)
	{
		indentDAO indentDao=new indentDAO();
		return indentDao.getRecord(indentId);
	}
	
	public int delindent(indentBean indent)
	{
		indentDAO indentDao=new indentDAO();
		if(indentDao.deleteRecord(indent))
			return 1;
		else
			return 2;
	}
	
	public int updateindent(indentBean beforeRecord,indentBean afterRecord)
	{
		indentDAO indentDao=new indentDAO();
		if(indentDao.updateRecord(beforeRecord,afterRecord))
			return 1;
		else
			return 2;
	}
}
